home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / rayshade / rayfiles / rsdefs / objects / clean.rh < prev    next >
Encoding:
Text File  |  1995-01-12  |  7.6 KB  |  276 lines

  1.  
  2.  
  3. /************************************************************************
  4.  *
  5.  *      clean.rh
  6.  *
  7.  *      This is an #include file for the Rayshade Standard Header
  8.  *      Files.  It defines the "clean" superprimitives in the package.
  9.  *
  10.  *      Please do not edit this file, or any of the other files in
  11.  *      this package!  Make additions to these in your own separate
  12.  *      file.  If you think you have something that should be added
  13.  *      permanently, please send it to Larry Coffin and/or David
  14.  *      DeBry (email addresses listed below).  If we include it in
  15.  *      the next release, we'll put your name in the contributor's
  16.  *      list.
  17.  *
  18.  *      Contributors (in alphabetical order):
  19.  *          Larry Coffin <lcoffin@clciris.chem.umr.edu>
  20.  *        Craig Kolb <cek@Princeton.EDU>
  21.  *          David DeBry <ddebry@dsd.es.com>
  22.  *          Stuart Warmink <sw@groucho.att.com>
  23.  */
  24.  
  25.  
  26. #ifndef RSHF_CLEAN
  27. #define RSHF_CLEAN
  28.  
  29. #include "rounded.rh"
  30.  
  31. #define RSPtoothbrush(prefix, surf)                    \
  32. RSProundedbox(name RSPtb_handle_tmp, -5.5, -.5, -.4, 5.5, .5, .4, .2)    \
  33.                                     \
  34. name RSPtb_handle object RSPtb_handle_tmp                \
  35.     translate -5.5 0 0                        \
  36.                                     \
  37. name RSPtb_basic_cone                            \
  38.     list                                \
  39.     disc (.4/ cos(dtor*13))  0 0 0  -1 0 0                \
  40.     cone (.4/ cos(dtor*13))     0 0 0                    \
  41.          (.25/ cos(dtor*13)) 5 0 0                    \
  42.     disc (.25/ cos(dtor*13)) 5 0 0   1 0 0                \
  43.     end                                    \
  44.                                     \
  45. name RSPtb_extension object RSPtb_basic_cone                \
  46.     scale 1 1.25 1                            \
  47.     rotate 0 1 0  13                            \
  48.     translate    (-0.2 - (0.4*tan(dtor*13))) 0 0                \
  49.                                     \
  50. name RSPtb_basic_cylinder                        \
  51.     list                                \
  52.     disc      1   1 0 0   1 0 0                    \
  53.     cylinder 1   1 0 0  -1 0 0                    \
  54.     disc      1  -1 0 0  -1 0 0                    \
  55.     end                                    \
  56.                                     \
  57. name RSPtb_head_end                            \
  58.     union                                \
  59.     torus    0.6 0.25    0 0 0    0 0 1                \
  60.     object    RSPtb_basic_cylinder                    \
  61.         scale    0.25 0.6 0.6                    \
  62.         rotate    0 0 1    90                    \
  63.         rotate    1 0 0    90                    \
  64.     end                                    \
  65.                                     \
  66. name RSPtb_head_middle                            \
  67.     union                                \
  68.     box 1.0 0.6 0.25  -1.0 -0.6 -0.25                \
  69.     list                                \
  70.         object RSPtb_basic_cylinder                    \
  71.         scale 1.0  0.25 0.25                    \
  72.         translate 0 0.6 0                    \
  73.         object RSPtb_basic_cylinder                    \
  74.         scale 1.0  0.25 0.25                    \
  75.         translate 0 -0.6 0                    \
  76.     end                                \
  77.     end                                    \
  78.                                     \
  79. name RSPtb_head_body                            \
  80.     union                                \
  81.     object RSPtb_head_middle                    \
  82.     list                                \
  83.         object RSPtb_head_end                    \
  84.         translate    1.0 0 0                    \
  85.         object RSPtb_head_end                    \
  86.         translate    -1.0 0 0                \
  87.     end                                \
  88.     end                                    \
  89.                                     \
  90. name RSPtb_bristle                            \
  91.     object RSSbristle_white() RSPtb_basic_cylinder            \
  92.     scale 0.7 0.13 0.13                        \
  93.     rotate 0 1 0 90                            \
  94.     translate 0 0 0.7                        \
  95.     texture bump 1 scale .01 .01 10                    \
  96.                                     \
  97. name RSPtb_bristle_set                            \
  98.     list                                \
  99.     object    RSPtb_bristle    translate     0.2 -0.5 0        \
  100.     object    RSPtb_bristle    translate     0.2  0.5 0        \
  101.     object    RSPtb_bristle    translate     0.2  0.0 0        \
  102.     object    RSPtb_bristle    translate     0.4 -0.25 0        \
  103.     object    RSPtb_bristle    translate     0.4  0.25 0        \
  104.     end                                    \
  105.                                     \
  106. name    RSPtb_bristles                            \
  107.     list                                \
  108.     object    RSPtb_bristle_set                    \
  109.     object    RSPtb_bristle_set    translate     0.4 0 0    \
  110.     object    RSPtb_bristle_set    translate     0.8 0 0    \
  111.     object    RSPtb_bristle        translate     1.4 0 0    \
  112.     object    RSPtb_bristle_set    translate    -0.4 0 0    \
  113.     object    RSPtb_bristle_set    translate    -0.8 0 0    \
  114.     object    RSPtb_bristle_set    translate    -1.2 0 0    \
  115.     object    RSPtb_bristle        translate    -1.2 -0.25 0    \
  116.     object    RSPtb_bristle        translate    -1.2  0.25 0    \
  117.     end                                    \
  118.                                     \
  119. name     RSPtb_head                            \
  120.     grid 10 5 5                             \
  121.     difference                            \
  122.         object    RSPtb_head_body                    \
  123.         object    RSPtb_bristles                    \
  124.         scale        1.001 1.001 1.001            \
  125.     end                                \
  126.     object    RSPtb_bristles                        \
  127.     end                                    \
  128.                                     \
  129. name RSPtb_brush                            \
  130.     grid 15 5 10                            \
  131.         union                                \
  132.         object RSPtb_handle                        \
  133.         union                            \
  134.             object RSPtb_extension                    \
  135.             object RSPtb_head                    \
  136.             translate                        \
  137.                 (-0.2 - (0.4*tan(dtor*13)) + (5*cos(dtor*13)) + 1.0 -(0.2*tan(dtor*13)))    \
  138.                 0 (-5*sin(dtor*13))            \
  139.         end                                \
  140.         end                                \
  141.     end                                    \
  142.                                     \
  143. prefix object surf RSPtb_brush
  144.  
  145. #define RSPsoapbar(prefix, surf)                    \
  146. RSProundedbox(name RSPsoap_tmp, -2, -1.25, -1.25, 2, 1.25, 1.25, 0.8)    \
  147.     scale    2 2 1                            \
  148.     RSTlightgray_marb(6,1,1)                    \
  149.         translate 0 0 -0.1                        \
  150. prefix object surf RSPsoap_tmp
  151.  
  152. #define RSPsoap_dish(prefix, surf)                    \
  153. name RSPsd_ridge                            \
  154.     list                                \
  155.     disc     0.5    0  4.5 0    0  1 0                \
  156.     cylinder 0.5    0  4.5 0    0 -4.5 0            \
  157.     disc     0.5    0 -4.5 0    0 -1 0                \
  158.     end                                    \
  159. name RSPsd_holder union                            \
  160.     union                                \
  161.     difference                            \
  162.         RSProundedbox(, -7, -4.5, -1, 7, 4.5, 1, 0.5)        \
  163.         RSProundedbox(, -6, -3.5, -2, 6, 3.5, 2, 0.9)        \
  164.         translate 0 0 2.25                    \
  165.     end                                \
  166.     list                                \
  167.         object RSPsd_ridge    translate  4 0 0.0            \
  168.         object RSPsd_ridge    translate  2 0 0.0            \
  169.         object RSPsd_ridge    translate  0 0 0.0            \
  170.         object RSPsd_ridge    translate -2 0 0.0            \
  171.         object RSPsd_ridge    translate -4 0 0.0            \
  172.     end                                \
  173.     end                                    \
  174.     box    5 0 -0.75    -5 0.5 0.75                    \
  175.     translate    0 -4.5 0                    \
  176. end                                    \
  177. prefix object surf RSPsd_holder
  178.  
  179. #define RSPsoap_and_dish(prefix, s_surf, d_surf)            \
  180. prefix grid 10 8 10                            \
  181.     RSPsoap_dish(, d_surf)                        \
  182.     RSPsoapbar(, s_surf)                        \
  183.     rotate    0 0 1    -6                        \
  184.     translate -0.3 -0.2 (0.5 + 1.25)                \
  185. end
  186.  
  187. #define RSPglass(prefix, surf)                        \
  188. name RSPglass_tmp union                            \
  189.     torus 0.95 0.06 0 0 2 0 0 1                        \
  190.     difference                                \
  191.     list /* outer glass */                        \
  192.         cone 0.9 0 0 -0.001 1.0 0 0 2                \
  193.         disc 1 0 0 2 0 0 1                        \
  194.         disc 0.9 0 0 -.001 0 0 -1                    \
  195.     end                                \
  196.     list /* inner glass */                        \
  197.         cone 0.7 0 0 0.1   0.9 0 0 2.2                \
  198.         disc .9 0 0 2.2 0 0 1                    \
  199.         disc .7 0 0 0.1 0 0 -1                    \
  200.     end                                \
  201.     end                                    \
  202. end                                    \
  203.     texture bump 0.2 scale .2 .2 .2                    \
  204. prefix object surf RSPglass_tmp
  205.  
  206. #define RSPglass_holder(prefix, surf)                    \
  207. name RSPgh_unit_cyl                            \
  208.     list                                \
  209.     disc        1    0 0 1    0 0 1                \
  210.     cylinder    1    0 0 0    0 0 1                \
  211.     disc        1    0 0 0    0 0 -1                \
  212.     end                                    \
  213.                                     \
  214. name RSPgh_indent_big                            \
  215.     union                                \
  216.     object    RSPgh_unit_cyl                        \
  217.         scale    3.5 3.5 0.5                    \
  218.         translate    0 0 0.3                        \
  219.     union                                \
  220.         object    RSPgh_unit_cyl                    \
  221.         scale    3.2 3.2 0.4                    \
  222.         union                            \
  223.         torus    3.2 0.3        0 0 0.3        0 0 1        \
  224.         difference                        \
  225.             object    RSPgh_unit_cyl                \
  226.             scale    3.8 3.8 0.4                \
  227.             translate    0 0 0.7                \
  228.             torus    3.8 0.3    0 0 0.7        0 0 1        \
  229.         end                            \
  230.         end                                \
  231.     end                                \
  232.     end                                    \
  233.                                     \
  234. name RSPgl_indent_small                            \
  235.     union                                \
  236.     object    RSPgh_unit_cyl                        \
  237.         scale    0.6 0.6 3                    \
  238.         translate    0 0 -2.9                    \
  239.     difference                            \
  240.         object    RSPgh_unit_cyl                    \
  241.         scale    0.9 0.9 0.4                    \
  242.         torus    0.9 0.3        0 0 0    0 0 1            \
  243.     end                                \
  244.     end                                    \
  245.     translate    0 0 -0.3                    \
  246.                                     \
  247. name RSPgh_holes                            \
  248.     list                                \
  249.     object    RSPgh_indent_big                    \
  250.     object    RSPgl_indent_small                    \
  251.         translate    -5.5 -2.8 1                    \
  252.     object    RSPgl_indent_small                    \
  253.         translate     5.5 -2.8 1                    \
  254.     object    RSPgl_indent_small                    \
  255.         translate    -5.5  2.8 1                    \
  256.     object    RSPgl_indent_small                    \
  257.         translate     5.5  2.8 1                    \
  258.     end                                    \
  259.                                     \
  260. name RSPgh_holder                            \
  261.     grid 15 15 15                            \
  262.         union                                \
  263.         difference                            \
  264.             RSProundedbox(, -7, -4.5, -1, 7, 4.5, 1, 0.5)        \
  265.             object    RSPgh_holes                    \
  266.         end                                \
  267.         box    5 0 -0.75    -5 0.5 0.75                \
  268.             translate    0 -4.5 0                \
  269.         end                                \
  270.     end                                    \
  271.                                     \
  272. prefix object surf RSPgh_holder
  273.  
  274. #endif /* ifndef RSHF_CLEAN */
  275.  
  276.